package com.huyanqi.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

import com.huyanqi.core.BaseDomainObject;

@Entity
@Table(name = "f_friends")
@XmlAccessorType(XmlAccessType.FIELD)
public class Friends extends BaseDomainObject {
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Id
	@Column(name="fu_id",nullable=false)
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Long fuId;

	public void setFuId(Long fuId) {
		this.fuId = fuId;
	}
	public Long getFuId() {
		return fuId;
	}

	@Column(name="u_id")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Long uId;

	public void setUId(Long uId) {
		this.uId = uId;
	}
	public Long getUId() {
		return uId;
	}

	@Column(name="f_id")
	@XmlElement
	@Basic(fetch=FetchType.EAGER)
	private Long fId;

	public void setFId(Long fId) {
		this.fId = fId;
	}
	public Long getFId() {
		return fId;
	}
	
	@Transient
	private User friend;
	public User getFriend() {
		return friend;
	}
	public void setFriend(User friend) {
		this.friend = friend;
	}
	public Friends() {}
	public Friends(Long fuId, Long uId, Long fId, User friend) {
		super();
		this.fuId = fuId;
		this.uId = uId;
		this.fId = fId;
		this.friend = friend;
	}

}